-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(koa): add layer type to request hook context #1226
Merged
blumamir
merged 3 commits into
open-telemetry:main
from
unflxw:add-layer-type-to-koa-request-hook-context
Oct 18, 2022
Merged
feat(koa): add layer type to request hook context #1226
blumamir
merged 3 commits into
open-telemetry:main
from
unflxw:add-layer-type-to-koa-request-hook-context
Oct 18, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unflxw
force-pushed
the
add-layer-type-to-koa-request-hook-context
branch
from
October 11, 2022 11:32
76bae85
to
2cda169
Compare
rauno56
approved these changes
Oct 12, 2022
The failure in the browser tests seems unrelated to me (different package) -- let me know if there's something that needs to be looked at before merging this. |
unflxw
force-pushed
the
add-layer-type-to-koa-request-hook-context
branch
from
October 14, 2022 09:05
2cda169
to
4284f87
Compare
vmarchaud
approved these changes
Oct 15, 2022
blumamir
approved these changes
Oct 16, 2022
Merged
tombruijn
added a commit
to tombruijn/opentelemetry-js-contrib
that referenced
this pull request
Nov 30, 2022
Add the layerType argument to the requestHook function. This is like the following PR but for restify: open-telemetry#1226 Move the LayerType from internal-types to types, because it's now used in a function used by users of the instrumentation package.
blumamir
added a commit
that referenced
this pull request
Dec 13, 2022
* feat(restify): add requestHook support The `requestHook` config option allows custom span handling per request layer. * fix(restify): pass config to super class As mentioned in the review, pass the instrumentation config to the parent class. That way the config is also stored when given to the initializer, rather only when using the `setConfig` function. * fix(restify): fix comment referencing restify type Update comment to reference to correct type from the `@types/restify` package. * fix(restify): import missing Span type Add the missing import reported by the linter. * fix(restify): fix issues reported by linter * fix(restify): fix comment referencing restify type Mention the package name exactly. * fix(restify): fix comment referencing restify type Co-authored-by: Amir Blum <[email protected]> * fix(restify): add missing import in restify test * feat(restify): add layer argument to requestHook Add the layerType argument to the requestHook function. This is like the following PR but for restify: #1226 Move the LayerType from internal-types to types, because it's now used in a function used by users of the instrumentation package. Co-authored-by: Amir Blum <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Unlike the context given to the Express request hook, the Koa request hook context does not contain information on whether the layer whose instrumentation is being intercepted by the request hook is a middleware layer or a router layer.
Short description of the changes
layerType
to the context object passed to therequestHook
interceptor function.layerType
property to theKoaRequestInfo
context type.